<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/18
 * Time: 16:28
 */
$arr = array('tom','jack','frank','andy');
$b = array_rand($arr,2);
var_dump($b);
for($i=0;$i<count($b);$i++){
    echo $arr[$b[$i]];
}
//var_dump($b);